package edu.wuster.blog.mapper;

import edu.wuster.blog.entity.Report;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;



@Mapper
public interface ReportMapper {
    @Select("select * from report where is_delete = 0;")
    List<Report> select();

    @Insert("insert into report(blog_id, text, create_time) values (#{blogId},#{text},#{createTime})")
    void addReport(Report report);

    @Update("update report set is_delete = 1 where id = #{id}")
    void deleteById(Integer id);
}
